/*
 *
Derived func
Derived foo

 */

#include <iostream>
using namespace std;
class A{};
class B:public A{};
class Base{
	public:
		virtual void func(void){
			cout << "Base func" << endl;
		}
		virtual A* foo(void){
			cout << "Base foo" << endl;
		}
};
class Derived: public Base{
	void func(void) {
		cout <<"Derived func" << endl;
	}
	B* foo(void){
		cout << "Derived foo" << endl; 
	}
};
int main(void){

	Derived d1;
	Base *pd1 = &d1;
	pd1->func();
	
	Base& pd2 = d1;
	pd2.foo();
	return 0;
}
